package com.xlh.param.user;

import com.xlh.util.InputValidator;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.util.Date;
import java.util.List;

/**
 * 创建高校教师参数
 * <p>
 * Created by lx on 2019/2/24.
 */
@Data
public class CreateUniversityTeacherParam {

    @ApiModelProperty(value = "申请码")
    @Length(max = 7, message = "申请码不能超过7个字符")
    private String invitationCode;

    @ApiModelProperty(value = "销毁天数")
    private Integer destroyedDays = 7;

    @ApiModelProperty(value = "工号/学号")
    @Length(max = 20, message = "工号/学号不能超过20个字符")
    private String userNumber;

    @ApiModelProperty(value = "密码")
    @Length(max = 14, message = "密码不能超过14个字符")
    private String password;

    @ApiModelProperty(value = "姓名")
    @Length(max = 10, message = "姓名不能超过10个字符")
    private String name;

    @ApiModelProperty(value = "手机号")
    @Length(max = 11, message = "请输入正确的手机号")
    private String telephoneNumber;

    @ApiModelProperty(value = "邮箱")
    @Length(max = 50, message = "邮箱不能超过50个字符")
    private String email;

    @ApiModelProperty(value = "性别")
    private Integer sex;

    @ApiModelProperty(value = "性别名称")
    private String sexName;

    @ApiModelProperty(value = "角色")
    private Integer role;

    @ApiModelProperty(value = "角色名称")
    private String roleName;

    @ApiModelProperty(value = "省份")
    @Length(max = 10, message = "省份不能超过10个字符")
    private String province;

    @ApiModelProperty(value = "学校")
    @Length(max = 30, message = "学校不能超过30个字符")
    private String schoolName;

    @ApiModelProperty(value = "销毁日期")
    private Date destroyTime;

    @ApiModelProperty(value = "销毁日期字符串")
    private String destroyTimeStr;

    @ApiModelProperty(value = "申请人")
    @Length(max = 20, message = "申请人不能超过20个字符")
    private String applicant;

    @ApiModelProperty(value = "课程方向权限隐藏id集合")
    private List<Integer> courseDirectionHideIds;

    public String getInvitationCode() {
        return invitationCode == null ? null : InputValidator.regSpecialChar(invitationCode);
    }

    public String getName() {
        return name == null ? null : InputValidator.regSpecialChar(name).replaceAll(" ", "");
    }

    public String getTelephoneNumber() {
        return telephoneNumber == null ? null : InputValidator.regSpecialChar(telephoneNumber);
    }

    public String getEmail() {
        return email == null ? null : InputValidator.regSpecialChar(email).replaceAll(" ", "");
    }

    public String getSchoolName() {
        return schoolName == null ? null : InputValidator.regSpecialChar(schoolName).replaceAll(" ", "");
    }

    public String getProvince() {
        return province == null ? null : InputValidator.regSpecialChar(province).replaceAll(" ", "");
    }

    public String getApplicant() {
        return applicant == null ? null : InputValidator.regSpecialChar(applicant).replaceAll(" ", "");
    }

    public String getDestroyTimeStr() {
        return destroyTimeStr == null ? null : InputValidator.regSpecialChar(destroyTimeStr).replaceAll(" ", "");
    }

    public String getSexName() {
        return sexName == null ? null : InputValidator.regSpecialChar(sexName).replaceAll(" ", "");
    }

    public Integer getSex() {
        return sex == null ? null : sex;
    }

    public String getRoleName() {
        return roleName == null ? null : InputValidator.regSpecialChar(roleName).replaceAll(" ", "");
    }

    public String getUserNumber() {
        return userNumber == null ? null : InputValidator.regSpecialChar(userNumber).replaceAll(" ", "");
    }

    public String getPassword() {
        return password == null ? null : InputValidator.regSpecialChar(password);
    }
}
